<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('历史职员信息')"/>
    <th:block th:include="include :: layout-latest-css"/>
    <th:block th:include="include :: ztree-css"/>
    <th:block th:include="include :: bootstrap-editable-css"/>
    <th:block th:include="include :: container-css"/>
    <th:block th:include="include :: select2-css"/>
</head>
<style>
    .fixed-table-container .bs-checkbox .th-inner {
        padding: 8px 8px !important;
    }

</style>
<body class="gray-bg">
<div class="modal inmodal fade" id="myModal1" tabindex="-1" role="dialog" aria-hidden="true">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span
                        class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">职员信息</h4>
            </div>
            <div class="modal-body">
                <p>
                    查询日期:
                <div class="input-group date">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    <input type="text" id="term" class="form-control laydate-demo-2" placeholder="yyyy-MM-dd">
                </div>
                </p>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-white" id="close" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" onclick="getData()">确定</button>
            </div>
        </div>
    </div>
</div>
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <p>工号：</p>
                            <input type="text" name="badge"/>
                        </li>
                        <li>
                            <p>姓名：</p>
                            <input type="text" name="name"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success single" onclick="EmpBackGroud()">
                职员背景信息
            </a>
        </div>


        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: layout-latest-js"/>
<th:block th:include="include :: ztree-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<th:block th:include="include :: hr-help-js"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">

    var prefix = ctx + "empInfo/incumbencyEmp";
    $(function () {
        $("#myModal1").modal('show');
        $(".datetimepicker-demo-2").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-2',
                type: 'date'
            });

        });
        $(".datetimepicker-demo-1").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
        layui.use('laydate', function () {
            var laydate = layui.laydate;
            laydate.render({
                elem: '.laydate-demo-1',
                type: 'date'
            });

        });
    });

    function getData() {
        var term = $("#term").val();
        var columns = [];
        var checkbox = {checkbox: true};
        var term1 = {field: 'term', title: '查询日期'};
        var badge = {field: 'badge', title: '工号'};
        var empStatusTitle = {field: 'empStatusTitle', title: '员工状态'};
        var compName = {field: 'compName', title: '公司名称'};
        var depName = {field: 'depName', title: '部门名称'};
        var name = {field: 'name', title: '姓名'};
        var JoinDate = {field: 'JoinDate', title: '入职日期'};
        var jobName = {field: 'jobName', title: '工作岗位'};
        var JobGradeTitle = {field: 'JobGradeTitle', title: '岗位级别'};
        var JobTypeTitle = {field: 'JobTypeTitle', title: '岗位类型'};
        var GenderTitle = {field: 'GenderTitle', title: '性别'};
        var age = {field: 'age', title: '年龄'};
        var WorkBeginDate = {field: 'WorkBeginDate', title: '参加工作时间'};
        var MarriageTitle = {field: 'MarriageTitle', title: '婚姻状况'};
        var NationTitle = {field: 'NationTitle', title: '名族'};
        var Resident = {field: 'Resident', title: '籍贯'};
        var PartyTitle = {field: 'PartyTitle', title: '政治面貌'};
        var CertNo = {field: 'CertNo', title: '身份证号码'};
        var BirthDay = {field: 'BirthDay', title: '出生日期'};
        var HighLevelTitle = {field: 'HighLevelTitle', title: '最高学历'};
        var highschool = {field: 'highschool', title: '最高学历毕业院校'};
        var highenddate = {field: 'highenddate', title: '最高学历毕业时间'};
        var Major = {field: 'Major', title: '最高学历专业'};
        var HighTitle = {field: 'HighTitle', title: '最高职称/资格证书'};
        var Cyear = {field: 'Cyear', title: '司龄'};
        var ReportToName = {field: 'ReportToName', title: '直接上级'};
        var WFReportToName = {field: 'WFReportToName', title: '职能上级'};
        var JobBeginDate = {field: 'JobBeginDate', title: '从岗日期'};
        var Jyear = {field: 'Jyear', title: '岗龄'};
        var JobStatusTitle = {field: 'JobStatusTitle', title: '在岗状态'};
        var EmpTypeTitle = {field: 'EmpTypeTitle', title: '员工类别'};
        var WorkCityTitle = {field: 'WorkCityTitle', title: '工作城市'};
        var PracTerm = {field: 'PracTerm', title: '实习期限'};
        var PracEndDate = {field: 'PracEndDate', title: '实习终止日期'};
        var practotime = {field: 'practotime', title: '实习转正日期'};
        var ProbTerm = {field: 'ProbTerm', title: '试用期'};
        var ProbEndDate = {field: 'ProbEndDate', title: '试用终止日期'};
        var probtotime = {field: 'probtotime', title: '试用转正日期'};
        var ConTypeTitle = {field: 'ConTypeTitle', title: '合同类型'};
        var ConPropertyTitle = {field: 'ConPropertyTitle', title: '合同属性'};
        var Contract = {field: 'Contract', title: '签约单位'};
        var conCount = {field: 'conCount', title: '合同次数'};
        var ConBeginDate = {field: 'ConBeginDate', title: '合同开始日期'};
        var ConTerm = {field: 'ConTerm', title: '合同期'};
        var ConEndDate = {field: 'ConEndDate', title: '合同结束日期'};
        var certaddress = {field: 'certaddress', title: '身份证地址'};
        var Address = {field: 'Address', title: '现在住址'};
        var Tel = {field: 'Tel', title: '联系电话'};
        var EMail = {field: 'EMail', title: '公司邮箱'};
        var Constellation = {field: 'Constellation', title: '星座'};
        var QQ = {field: 'QQ', title: 'QQ'};
        var Wechart = {field: 'Wechart', title: '微信'};
        var CyearAdjust = {field: 'CyearAdjust', title: '司龄调整'};
        var JoinTypeTitle = {field: 'JoinTypeTitle', title: '入职渠道'};
        var army = {field: 'army', title: '是否参军'};
        var leavearmy = {field: 'leavearmy', title: '退伍部队'};
        var archiveid = {field: 'archiveid', title: '档案号'};
        var EmergencyName = {field: 'EmergencyName', title: '紧急联系人'};
        var emergencytel = {field: 'emergencytel', title: '紧急联系人电话'};
        columns.push(checkbox,term1,badge,empStatusTitle,compName,depName,name,JoinDate,jobName,JobGradeTitle,JobTypeTitle,GenderTitle);
        columns.push(age,WorkBeginDate,MarriageTitle,NationTitle,Resident,PartyTitle,CertNo,BirthDay,HighLevelTitle,highschool);
        columns.push(highenddate,Major,HighTitle,Cyear,ReportToName,WFReportToName,JobBeginDate,Jyear,JobStatusTitle,EmpTypeTitle);
        columns.push(WorkCityTitle,PracTerm,PracEndDate,practotime,ProbTerm,ProbEndDate,probtotime,ConTypeTitle,ConPropertyTitle);
        columns.push(Contract,conCount,ConBeginDate,ConTerm,ConEndDate,certaddress,Address,Tel,EMail,Constellation,QQ,Wechart);
        columns.push(CyearAdjust,JoinTypeTitle,army,leavearmy,archiveid,EmergencyName,emergencytel);


        $("#close").click();
        var options = {
            code: "eid",
            uniqueId: "eid",
            url: prefix + "/empInfoHistoryList?term=" + term,
            height: $(window).height() - 120,
            modalName: "历史职员信息",
            columns: columns
        };
        $.table.init(options);
    }

    function EmpBackGroud() {
        var row = $("#bootstrap-table").bootstrapTable('getSelections');
        var eid = row[0].eid;
        $.modal.openFull(row[0].name + ":职员信息", ctx + "empInfo/backGroundInfo?eid=" + eid);
    }


</script>
</body>
</html>